package com.ssm.service.bill;

import com.ssm.dao.BillMapper;
import com.ssm.pojo.Bill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class BillServiceImpl implements BillService {
    @Autowired
    @Qualifier("billMapper")
    private BillMapper billMapper;
    @Override
    public List<Bill> getBillList(String productName, Integer providerId, Integer isPayment, int offset, int pageSize) {
        return billMapper.getBillList(productName, providerId, isPayment, offset, pageSize);
    }

    @Override
    public int getBillCount(String productName, Integer providerId, Integer isPayment) {
        return billMapper.getBillCount(productName, providerId, isPayment);
    }

    @Override
    public Bill getBillById(String id) {
        return billMapper.getBillById(id);
    }

    @Override
    public int modifyBill(String billCode, String productName, String productUnit, BigDecimal productCount, BigDecimal totalPrice, Integer providerId, Integer isPayment) {
        return billMapper.modifyBill(billCode, productName, productUnit, productCount, totalPrice, providerId, isPayment);
    }

    @Override
    public int deleteBillById(String id) {
        return billMapper.deleteBillById(id);
    }
}
